import request from '@/utils/request'

// 创建合作伙伴
export function createPartner (data) {
  return request({
    url: '/cooperative/partner/create',
    method: 'post',
    data: data
  })
}

// 更新合作伙伴
export function updatePartner (data) {
  return request({
    url: '/cooperative/partner/update',
    method: 'put',
    data: data
  })
}

// 删除合作伙伴
export function deletePartner (id) {
  return request({
    url: '/cooperative/partner/delete?id=' + id,
    method: 'delete'
  })
}

// 获得合作伙伴
export function getPartner (id) {
  return request({
    url: '/cooperative/partner/get?id=' + id,
    method: 'get'
  })
}

// 获得合作伙伴分页
export function getPartnerPage (query) {
  return request({
    url: '/cooperative/partner/page',
    method: 'get',
    params: query
  })
}

// 导出合作伙伴 Excel
export function exportPartnerExcel (query) {
  return request({
    url: '/cooperative/partner/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

//获得合作伙伴统计
export function getPartnerSum () {
  return request({
    url: '/cooperative/partner/sum-partner-type',
    method: 'get',
  })
}